package com.youlin.dto.res;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang.StringUtils;
import java.time.LocalDate;
import java.util.List;

@NoArgsConstructor
@Data
@Accessors(chain=true)
public class DeadManResDto {

    // 预约ID
    @ApiModelProperty(hidden = true)
    private Integer amId;

    // 预约ID
    @ApiModelProperty(value="告别会状态：0-新建、1-已预约、2-待审核、3-审核中(不可签到)、4-已审核(不可签到)", position = 10)
    private Integer status;

    // 签到唯一标识ID
    @ApiModelProperty(value = "签到唯一标识ID", position = 20)
    private String siId;

    // 逝者姓名
    @ApiModelProperty(value = "逝者姓名", position = 30)
    private String deadName;

    // 逝者性别：0-男、1-女
    @ApiModelProperty(value = "逝者性别：0-男、1-女", position = 35)
    private Integer deadGender;

    // 逝者生日
    @ApiModelProperty(value = "逝者生日", dataType = "java.lang.String", example = "2020-02-02", position = 40)
    private LocalDate deadBirthday;

    // 逝者忌日
    @ApiModelProperty(value = "逝者忌日", dataType = "java.lang.String", example = "2020-02-02", position = 50)
    private LocalDate deadDeadday;

    // 文案名称
    @ApiModelProperty(value = "文案名称", position = 55)
    private String txName;

    public String getTxName() {
        if (StringUtils.isBlank(txName)) return null;
        return txName.replaceAll("XXX", this.deadName);
    }

    // 遗像url
    @ApiModelProperty(value = "遗像url", position = 60)
    private String headUrl;

    // 遗像边框url
    @ApiModelProperty(value = "遗像边框url", position = 65)
    private String headBrUrl;

    // 遗像背景url
    @ApiModelProperty(value = "遗像主背景url", position = 70)
    private String headBgUrl;

    // 遗像文案
    @ApiModelProperty(value = "遗像文案", position = 80)
    private String headTx;

    public String getHeadTx() {
        if (StringUtils.isBlank(headTx)) return null;
        return headTx.replaceAll("XXX", this.deadName);
    }

    // 逝者生平
    @ApiModelProperty(value = "逝者生平", position = 95)
    private String lifeStory;

    // 生平文案
    @ApiModelProperty(value = "生平文案", position = 100)
    private String lifeStoryTx;

    public String getLifeStoryTx() {
        if (StringUtils.isBlank(lifeStoryTx)) return null;
        return lifeStoryTx.replaceAll("XXX", this.deadName);
    }

    // 逝者生平背景url
    @ApiModelProperty(value = "生平主背景url", position = 110)
    private String lifeStoryBgUrl;

    // 逝者相册列表
    @ApiModelProperty(value = "逝者相册列表", position = 115)
    private List<PhotoResDto> photos;

    // 祝福主背景url
    @ApiModelProperty(value = "祝福主背景url", position = 120)
    private String signInBgUrl;

    // 祝福提示边框url
    @ApiModelProperty(value = "祝福提示边框url", position = 125)
    private String signInBrUrl;

    // 祝福提示边框尺寸
    @ApiModelProperty(value = "祝福提示边框尺寸", position = 127)
    private String signInBrWh;

    // 祝福献花_集合
    @ApiModelProperty(value = "祝福献花_集合", position = 130)
    private List<BgSitResDto> sifs;

    // 背景音乐url
    @ApiModelProperty(value = "背景音乐url", position = 150)
    private String musicUrl;

}
